# -*- coding: UTF-8 -*-
import numpy as np
from scipy.integrate import quad, dblquad, nquad


def startMain():
    # 1-integral
    print quad(lambda x: np.exp(-x), 0, np.inf)
    print dblquad(lambda t, x: np.exp(-x * t) / t ** 3, 0, np.inf, lambda x: 1, lambda x: np.inf)

    def f(x, y):
        return x * y

    def bound_y():
        return [0, 0.5]

    def bound_x(y):
        return [0, 1 - 2 * y]

    print nquad(f, [bound_x, bound_y])


def main():
    from scipy import linalg as lg
    arr = np.array([[1, 2], [3, 4]])
    print lg.det(arr)
    print lg.inv(arr)
    b = np.array([6, 14])
    print lg.solve(arr, b)
    print lg.eig(arr)


if __name__ == '__main__':
    main()
